package cn.whale.search;

import dev.langchain4j.web.search.searchapi.SearchApiWebSearchEngine;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class SearchConfig {

    /**
     * web搜索引擎
     */
    @Bean
    public SearchApiWebSearchEngine initWebSearchEngine(SearchProperties properties) {
        return SearchApiWebSearchEngine.builder()
                .engine(properties.getEngine())
                .apiKey(properties.getApiKey())
                .build();
    }
}
